from base_oss import BaseOSS

class FileOSS(object):

    def __init__(self,oss) -> None:
        self.oss_name = oss 
        self.oss:BaseOSS = eval(self.oss_name)()

    def upload_file(self,key,_file):
        upload_info = self.oss.save_file(key,_file)
        upload_info["Status"] = "Upload successed."
        upload_info["Group name"] = self.oss_name
        return upload_info
    
    def get_url(self,key,expired=120):
        url = self.oss.get_url(key,expired)
        return url 
    
    def delete_file(self,key):
        return self.oss.delete_file(key)